<template>
	<view class="page" style="padding-bottom: 50rpx;">
		<view class="topVue">
			<view class="safeVue" :style="{ height: statusBarHeight + 'rpx' }"></view>
			<view class="flex align-center padding-row30" :style="{ height: barHeight + 'rpx', top: statusBarHeight + 'rpx' }" @click="$tools.back()">
				<image src="../../static/back.png" style="width: 48rpx; height: 48rpx;"></image>
				<text style="line-height: 1; color: #454545; font-weight: 600; font-size: 32rpx; padding-left: 20rpx;">工分互换</text>
			</view>
		</view>
		<view :style="{ height: statusBarHeight + barHeight + 'rpx' }"></view>
		<view class="item flex align-center margin20 padding-row30">
			<view class="label">姓名</view>
			<input type="text" placeholder="请输入姓名" v-model="name"/>
		</view>
		<view class="item flex align-center margin20 padding-row30">
			<view class="label">手机号</view>
			<input type="text" placeholder="请输入手机号" v-model="phone"/>
		</view>
		<view class="item flex align-center margin20 padding-row30">
			<view class="label">性别</view>
			<u-radio-group v-model="value" active-color="#D37430" @change="radioGroupChange">
				<u-radio 
					@change="radioChange" 
					v-for="(item, index) in sexs" :key="index" 
					:name="item.name"
				>
					{{item.name}}
				</u-radio>
			</u-radio-group>
		</view>
		<view class="item flex align-center margin20 padding-row30">
			<view class="label">身份证号</view>
			<input type="text" placeholder="请输入身份证号" v-model="idCard"/>
		</view>
		<view class="item flex align-center margin20 padding-row30">
			<view class="label">地址</view>
			<input type="text" placeholder="请输入地址" v-model="address"/>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				statusBarHeight: 0,
				barHeight: 0,
				name: "",
				phone: "",
				idCard: '',
				address: "",
				sexs: [
					{
						name: '男',
						value: 1
					},
					{
						name: '女',
						value: 0
					},
				],
				value: "男"
			}
		},
		onLoad() {
			let that = this;
			wx.getSystemInfo({
				success(res) {
					let deviceWidth = wx.getSystemInfoSync().windowWidth
					that.statusBarHeight = Number(res.statusBarHeight) * ( 750 / deviceWidth ) 
					let menuButtonInfo = wx.getMenuButtonBoundingClientRect()
					let barHeight = menuButtonInfo.height + (menuButtonInfo.top - res.statusBarHeight) * 2
					that.barHeight = Number(barHeight) * ( 750 / deviceWidth )
				},
			});
		},
		
		methods: {
			radioGroupChange(){
				
			},
			radioChange(){}
		}
	}
</script>

<style lang="less" scoped>
	.topVue {
		width: 100%;
		background: #fff;
		position: fixed;
		left: 0;
		top: 0;
		z-index: 99;
		.safeVue {
			width: 100%;
		}
	}
	.item {
		width: 690rpx;
		height: 92rpx;
		background: #fff;
		border-radius: 20rpx;
		box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(178, 178, 178, 0.25), inset 0rpx 8rpx 8rpx 0rpx rgba(255, 255, 255, 0.25);
		.label {
			width: 200rpx;
			color: #454545;
			font-weight: 600;
			line-height: 1;
		}
	}
</style>